'use strict';
exports.main = async (event, context) => {
	//event为客户端上传的参数
	console.log('event : ', event)
	const db = uniCloud.database({});
	const shop = db.collection('db_user')
	// new RegExp(key, 'i')
	let dd;
	await shop.where({
		_id: event._id
	}).get().then(res => {
		console.log(res.data, 123)
		dd = res.data
	})
	if (dd.length > 0) {
		return await shop.where({
			_id: event._id
		}).update({
			pwd: event.pwd,
			uname: event.uname,
			sig: event.sig,
			addr: event.addr,
			addrDetail: event.addrDetail
		})
	}
	// return await shop.where({
	// 	_id: event._id
	// }).get()
};